<?

?>
<fb:serverfbml height="200px">
  <script type="text/fbml">
    <fb:fbml> 
      <fb:request-form action="<?= actionUrl('index', 'party') ?>" method="POST" invite="true" type="<?= $config['site.name'] ?>" 
        content="Join my adventuring party! <?php 
          echo htmlentities("<fb:req-choice url=\"http://creativepark.net/nerdia/?inv=".$this->inv_code."\" label=\"Join Party\"") ?>" > 
      <fb:multi-friend-selector showborder="false" actiontext="Invite your friends to <?= $config['site.name'] ?>."> 
    </fb:request-form> 
    </fb:fbml>
  </script>
</fb:serverfbml>
<?











#include('custom/partytabs.php');
if (1==2)
{
  ?>
  <form action="<?= actionUrl('preview', 'party') ?>" method="post">  
    <div style="width: 350px; height: 350px; overflow: auto;">    
      <table width="99%" cellspacing="0" cellpadding="4">
<?
    foreach($this->model->fbFriends as $id => $friend)
    {
      $row++;
              ?>
        <tr bgcolor="<?         if ($row % 2 == 0) print('#e0e0e8');       ?>">        <td>
            <label for="inv_<?= $id ?>">
              <img src="<?= $friend['u_fb_pic_square'] ?>"/>
            </label></td>        
          <td valign="top">          
<? 
          switch($friend['u_status'])
          {
            case('A'): {
              print('</td><td valign="top"><i style="color: gray">already a player</i>');
              }
            case('I'): {
              print('</td><td valign="top"><b style="color: gray">already invited</b>');
              }
            case('F'): {
              print('<input type="checkbox"');
              if ($_SESSION['invite'][$id] == true) print('checked');
              print(' name="inv_'.$id.'" id="inv_'.$id.'" value="Y"/> 
                </td><td valign="top"><b style="color: green"><label for="inv_'.$id.'">invite</label></b>');
              }          
          }
                      ?>        </td>        
          <td valign="top"><b>
              <label for="inv_<?= $id ?>">
                <?= $friend['u_fb_name'] ?>
              </label></b></td>      
        </tr>
<?
    }
            ?>    
      </table>  
    </div>  
    <div style="position: absolute; top: 150px; left: 400px;">    &lt;-- these are your friends (make sure it stays that way)
      <p/>    
      <br/>    Pick a few who you think might enjoy 
      <?= $config['site.name'] ?>!
      <br/>    The more people you invite, the bigger your adventuring party gets. With a     bigger party, you get 
      <a href="<?= actionUrl('index', 'cheat') ?>">Cheat Points</a>,     access to special items, and you become stronger in duels!
      <br/>    
      <br/>    Invitation Text:
      <br/>    
<textarea name="invtext" style="width: 100%; height: 100px"><?= getDefault($_SESSION['invtext'],
      'Hi there,
    
I\'m inviting you to join my adventuring party in '.$config['site.name'].'! You\'ll have tons of fun! :-)
'.$this->user->localRecord['u_fb_name']) ?></textarea>    
      <input type="submit" name="btn_submit" value="&gt; Preview and send your invitations">  
    </div>
  </form>
<?
}
  ?>